<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%@ page import="elibrary.DaoConnection" %>
<%@ page language="java" import="java.util.*"%>
<%@ include file="config.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Insert title here</title>
    </head>
    <body>
        <%


        try{
	
                //connection is made to the database
	
                Connection c=DaoConnection.getcon(connectURL, DBuser, DBpass);
                 Statement st=c.createStatement();
	   
	
                //if a requested is rejected then the request is deleted from the database
	
                String res=request.getParameter("res");
        if(res.equalsIgnoreCase("reject"))
        {
        String select[] = request.getParameterValues("id");
        if (select != null && select.length != 0) {

        for (int i = 0; i < select.length; i++) {
	

                 String str="DELETE FROM REQUEST WHERE BOOKNAME='"+select[i]+"'";
             st.executeUpdate(str);
        }
        }}
        }catch(Exception e){e.printStackTrace();}
        %>
    </body>
</html>